1. Technical Field
The present invention relates generally to an improved handling of interrupts and, in particular, to a method and an apparatus for managing interrupts between devices. Still more particularly, the present invention provides a method and an apparatus for dynamically allocating interrupts through a combination of hardware, firmware, and software.
2. Description of the Related Art
In a typical computer system, interrupts are handled via a host bridge between the devices plugged into card slots and the interrupt processing hardware and software. For example, in a PCI (Peripheral Component Interconnect) system there is a limited number of PCI interrupt inputs per PCI Host Bridge (PHB). These interrupt inputs must be distributed between all card slots and PCI bridges beneath the PHB. In a PCI system, each slot has four PCI interrupts. Single function devices only need one PCI interrupt while multifunction devices, such as a 4-port Ethernet adapter, may need up to four PCI interrupts.
The total number of interrupts available at the host bridge is typically less than the total maximum number of interrupt lines possible for all the card slots. For example, if a PHB is limited to 15 interrupt outputs and there are eight slots beneath a PHB, then 32 PCI interrupt inputs need to be distributed to the 15 PCI interrupt outputs on the PHB. This requires interrupt sharing, which can result in significant performance degradation.
These performance problems are particularly evident in a client-server model of computing where a single server must handle many clients. A 4-port Ethernet adapter card can service four clients at one time. If it is necessary to tie all four interrupts lines together, there will be a performance degradation of between 40-60 percent when compared with a 4-port Ethernet adapter that does not share interrupts. The last two ports also tended to have additional performance problems due to the nature of the interrupt polling software mechanism.
In today""s e-business, internet/intranet environment, multiport adapters are becoming very common, especially in the ISP/Webserver market. Therefore, it would be advantageous to have a method and an apparatus that allows dynamic allocation of interrupt lines through an interrupt management scheme that can be programmed to produce a highly efficient computational system.
A method and an apparatus is present for dynamically allocating a set of output interrupt lines at a host adapter to a set of input interrupt lines for card slots controlled by the host adapter. If the number of input interrupt lines is greater than the number of output lines, then interrupt sharing is necessary.
The number of input interrupt lines can be determined automatically by scanning all the card slots or can be determined by values stored in lookup tables. The algorithm to determine a logical mapping of the input interrupt lines to the output lines, in cases where interrupt sharing is required, can be based on a number of factors. A simple approach is to distribute the interrupts as equally as possible. Another algorithm may take into account the expected frequency of interrupts based on the device involved. Yet another approach may use a set of predetermined priorities. Since these algorithms are implemented in firmware or software, they can be changed to meet a particular set of needs.
Once the mapping is determined, the input interrupt lines are electronically connecting to the output interrupt lines using xe2x80x9cglue logicxe2x80x9d associated with the host adapter. After this mapping is accomplished, an interrupt mapping table is built and sent to the operating system.